3.253 \(\int (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=19 \[ a x+\frac{b \tan (c+d x)}{d}-b x \]

[Out]

a*x - b*x + (b*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0129866, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3473, 8} \[ a x+\frac{b \tan (c+d x)}{d}-b x \]

Antiderivative was successfully verified.

[In]

Int[a + b*Tan[c + d*x]^2,x]

[Out]

a*x - b*x + (b*Tan[c + d*x])/d

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \left (a+b \tan ^2(c+d x)\right ) \, dx &=a x+b \int \tan ^2(c+d x) \, dx\\ &=a x+\frac{b \tan (c+d x)}{d}-b \int 1 \, dx\\ &=a x-b x+\frac{b \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0063722, size = 28, normalized size = 1.47 \[ a x-\frac{b \tan ^{-1}(\tan (c+d x))}{d}+\frac{b \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Tan[c + d*x]^2,x]

[Out]

a*x - (b*ArcTan[Tan[c + d*x]])/d + (b*Tan[c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.001, size = 29, normalized size = 1.5 \begin{align*} ax+{\frac{b\tan \left ( dx+c \right ) }{d}}-{\frac{b\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*tan(d*x+c)^2,x)

[Out]

a*x+b*tan(d*x+c)/d-b/d*arctan(tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.63292, size = 31, normalized size = 1.63 \begin{align*} a x - \frac{{\left (d x + c - \tan \left (d x + c\right )\right )} b}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^2,x, algorithm="maxima")

[Out]

a*x - (d*x + c - tan(d*x + c))*b/d

________________________________________________________________________________________

Fricas [A]  time = 1.38478, size = 46, normalized size = 2.42 \begin{align*} \frac{{\left (a - b\right )} d x + b \tan \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^2,x, algorithm="fricas")

[Out]

((a - b)*d*x + b*tan(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.156409, size = 20, normalized size = 1.05 \begin{align*} a x + b \left (\begin{cases} - x + \frac{\tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \tan ^{2}{\left (c \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)**2,x)

[Out]

a*x + b*Piecewise((-x + tan(c + d*x)/d, Ne(d, 0)), (x*tan(c)**2, True))

________________________________________________________________________________________

Giac [B]  time = 1.26503, size = 312, normalized size = 16.42 \begin{align*} a x + \frac{{\left (\pi - 4 \, d x \tan \left (d x\right ) \tan \left (c\right ) - \pi \mathrm{sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) \tan \left (d x\right ) \tan \left (c\right ) - \pi \tan \left (d x\right ) \tan \left (c\right ) + 2 \, \arctan \left (\frac{\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 2 \, \arctan \left (\frac{\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 4 \, d x + \pi \mathrm{sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) - 2 \, \arctan \left (\frac{\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) - 2 \, \arctan \left (\frac{\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) - 4 \, \tan \left (d x\right ) - 4 \, \tan \left (c\right )\right )} b}{4 \,{\left (d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^2,x, algorithm="giac")

[Out]

a*x + 1/4*(pi - 4*d*x*tan(d*x)*tan(c) - pi*sgn(2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 - 2*tan(d*x) - 2*tan(
c))*tan(d*x)*tan(c) - pi*tan(d*x)*tan(c) + 2*arctan((tan(d*x)*tan(c) - 1)/(tan(d*x) + tan(c)))*tan(d*x)*tan(c)
 + 2*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)*tan(c) + 4*d*x + pi*sgn(2*tan(d*x)^2*tan(c) +
2*tan(d*x)*tan(c)^2 - 2*tan(d*x) - 2*tan(c)) - 2*arctan((tan(d*x)*tan(c) - 1)/(tan(d*x) + tan(c))) - 2*arctan(
(tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1)) - 4*tan(d*x) - 4*tan(c))*b/(d*tan(d*x)*tan(c) - d)